<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
  <head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2008. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="Content-Style-Type" content="text/css">
    <title>
      Create Getters and Setters
    </title>
    <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
  </head>
  <body>
    <h1>
      Create Getters and Setters
    </h1>
    <p>
      This dialog lets select the getter and setter methods to create.
    </p>
	<p>
     Use <strong>Generate Getters and Setters</strong> from the <a href="ref-menu-source.htm">Source menu</a> or the context menu on a selected field or type, or a text selection in
    a type to open the dialog.
     The Generate Getters and Setters dialog shows getters and setters for all fields of the selected type. The methods are grouped by the type's fields. 
	 </p>
    <p>
      The names of the getter and setter methods are derived from the field name. If you use a prefix or suffix for fields (e.g. fValue, _value, val_m), you can specify the
      suffixes and prefixes in the <a href="preferences/java/ref-preferences-code-style.htm">Code Style</a> preference page (Windows &gt; Preferences &gt; Java &gt; Code Style).
    </p>
    <p>
      When pressing&nbsp;<strong>OK</strong>, all selected getters and setters are created.
    </p>
    <table border="1" cellspacing="0" cellpadding="5" width="100%" summary="Getter/Setter options">
      <tr>
        <th>
          <p>
            Option
          </p>
        </th>
        <th>
          <p>
            Description
          </p>
        </th>
      </tr>
      <tr>
        <td valign="top">
          <p>
            Select getters and setters to create
          </p>
        </td>
        <td valign="top">
          <p>
            A tree containing getter and setter methods that can be created. Getters and setters are grouped by field their associated field.&nbsp;
          </p>
        </td>
      </tr>
      <tr>
        <td valign="top">
          <p>
            Select All
          </p>
        </td>
        <td valign="top">
          <p>
            Select all getter and setter methods
          </p>
        </td>
      </tr>
      <tr>
        <td valign="top">
          <p>
            Deselect All
          </p>
        </td>
        <td valign="top">
          <p>
            Deselect all getter and setter methods
          </p>
        </td>
      </tr>
      <tr>
        <td valign="top">
          <p>
            Select Getters
          </p>
        </td>
        <td valign="top">
          <p>
            Select all getter methods
          </p>
        </td>
      </tr>
      <tr>
        <td valign="top">
          <p>
            Insertion point
          </p>
        </td>
        <td valign="top">
          <p>
            Defines where in the type body the new methods are inserted
          </p>
        </td>
      </tr>
      <tr>
        <td valign="top">
          <p>
            Sort by
          </p>
        </td>
        <td valign="top">
            Defines how to sort the new methods:<br>
            <ul>
            <li>in getter/setter pairs</li>
            <li>first getters, then setters</li>
            </ul>
          
        </td>
      </tr>
      <tr>
        <td valign="top">
          <p>
            Access modifiers
          </p>
        </td>
        <td valign="top">
          <p>
            Defines the access modifiers of the new methods
          </p>
        </td>
      </tr>
      <tr>
        <td valign="top">
          <p>
            Generate method comments
          </p>
        </td>
        <td valign="top">
          <p>
            Controls whether Javadoc comments are added to the created methods.
            The comment templates are defined on the <a href="preferences/java/codestyle/ref-preferences-code-templates.htm">Code Templates</a> preference page.
          </p>
        </td>
      </tr>      
    </table>
    <h3 class="related">Related references</h3>
      <a href="../reference/ref-menu-source.htm">Source actions</a>
  </body>
</html>

